<template>
  <div>
    <Form ref="form" :model="data" :rules="rules">
      <FormItem label="内建测试字段0" prop="field0">
        <Input v-model="data.field0" clearable maxlength="512" placeholder="" :disabled="disabled"></Input>
      </FormItem>
      <FormItem label="内建测试字段1" prop="field1">
        <Select v-model="data.field1" clearable placeholder="选择..." transfer :disabled="disabled">
          <Option :key="0" label="选项0" :value="0"></Option>
          <Option :key="1" label="选项1" :value="1"></Option>
        </Select>
      </FormItem>
      <FormItem label="内建测试字段2" prop="field2">
        <Input v-model="data.field2" type="textarea" :rows="4" clearable placeholder="" :disabled="disabled"></Input>
      </FormItem>

    </Form>
  </div>
</template>

<script lang="ts">
import {Component, Vue, Prop, Watch, Emit} from 'vue-property-decorator';
import AbpBase from '@/lib/abpbase';

@Component({
  components: {},
})
export default class BuiltInSample extends AbpBase {
  name: string = 'BuiltInSample';
  @Prop({type: Boolean, default: true}) disabled: boolean;
  @Prop({type:Object, default:()=>{}}) data: any;

  rules={
    field0:[
      {
        required:true,
        message:'field0是必须的',
        trigger:'blur,change',
      },
    ],
  };

  getData() {

    return this.data;
  }


  getFields() {
    return [
      {
        key: 'field0',
        label: '内建测试字段0'
      },
      {
        key: 'field1',
        label: '内建测试字段1',
      },
      {
        key: 'field2',
        label: '内建测试字段2',
      }
    ];
  }



}
</script>

<style lang="less" scoped>

</style>
